<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>后台管理</title>

		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />

		<!-- page specific plugin styles -->

		<!-- text fonts -->
		<link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
		<![endif]-->
		<link rel="stylesheet" href="assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="assets/js/ace-extra.min.js"></script>

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if lte IE 8]>
		<script src="assets/js/html5shiv.min.js"></script>
		<script src="assets/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body class="no-skin">
		<div id="navbar" class="navbar navbar-default          ace-save-state">
			<div class="navbar-container ace-save-state" id="navbar-container">
				<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
					<span class="sr-only">Toggle sidebar</span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>
				</button>

				<div class="navbar-header pull-left">
					<a href="index.html" class="navbar-brand">
						<small>
							<i class="fa fa-leaf"></i>
							华夏医院管理后台
						</small>
					</a>
				</div>


			</div><!-- /.navbar-container -->
		</div>

		<div class="main-container ace-save-state" id="main-container">
			<script type="text/javascript">
				try{ace.settings.loadState('main-container')}catch(e){}
			</script>

			<div id="sidebar" class="sidebar                  responsive                    ace-save-state">
				<script type="text/javascript">
					try{ace.settings.loadState('sidebar')}catch(e){}
				</script>

				<div class="sidebar-shortcuts" id="sidebar-shortcuts">
					<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
						<button class="btn btn-success">
							<i class="ace-icon fa fa-signal"></i>
						</button>

						<button class="btn btn-info">
							<i class="ace-icon fa fa-pencil"></i>
						</button>

						<button class="btn btn-warning">
							<i class="ace-icon fa fa-users"></i>
						</button>

						<button class="btn btn-danger">
							<i class="ace-icon fa fa-cogs"></i>
						</button>
					</div>

					<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
						<span class="btn btn-success"></span>

						<span class="btn btn-info"></span>

						<span class="btn btn-warning"></span>

						<span class="btn btn-danger"></span>
					</div>
				</div><!-- /.sidebar-shortcuts -->

				<ul class="nav nav-list">
					<li class="">
						<a href="index.html">
							<i class="menu-icon fa fa-tachometer"></i>
							<span class="menu-text"> 医院主页 </span>
						</a>

						<b class="arrow"></b>
					</li>







				</ul>
					</div>
	`				<div>
			<div class="row" id="wrap" style="margin-left: 440px">
				<div class="col-md-4" style="width:300px"><h2>请选择您要查询的院区</h2></div>
				<div class="col-md-4" style="width:300px">
					<select class="form-control" style="margin-top: 20px" v-model="aid">
					<option value=1>武昌分院</option>
					<option value=2>汉口分院</option>
					<option value=3>江汉分院</option>
				</select>
				</div>
				<div class="col-md-4" style="width:300px">
					<button type="button" class="btn btn-success" style="margin-top: 20px;height: 36px" id="btn" @click="findAll(aid)">点击查询</button>
				</div>
				<div class="col-xs-12" style="width:800px;margin-left:-300px;margin-top: 30px;display:none"v-bind:style="{ display: status}">
					<table class="table table-bordered table-hover" id="simple-table" >
						<thead>
						<tr class="table_header">
							<td>
								编号
							</td>
							<td style="width:85px">
								医生名字
							</td>
							<td>
								所在科室
							</td>
							<td style="width:85px">
								{{oneweek[0]}}
							</td>
							<td style="width:85px">
								{{oneweek[1]}}
							</td>
							<td style="width:85px">
								{{oneweek[2]}}
							</td>
							<td style="width:85px">
								{{oneweek[3]}}
							</td>
							<td style="width:85px">
								{{oneweek[4]}}
							</td>
							<td style="width:85px">
								{{oneweek[5]}}
							</td>
							<td style="width:85px">
								{{oneweek[6]}}
							</td>

						</tr>
<!--						<tr v-for="(we,index) in oneweek" :key="we.id" :class="index%2==0?'row1':'row2'">-->
<!--						<td>{{we}}</td>-->
<!--						</tr>-->
						</thead>
						<tbody>
						<tr v-for="(emp,index) in schedulings" :key="emp.id" :class="index%2==0?'row1':'row2'">
							<td>
								{{ emp.id }}
							</td>
							<td>
								{{ emp.name }}
							</td>

							<td>
								{{ emp.department }}
							</td>
							<td>
								<button class="btn btn-app  btn-xs" v-show="emp.monday"style="background-color:#87B87F;"><a clas="btn btn-app btn-inverse btn-xs" style="color:#FFFFFF" v-model="schedule" >{{ emp.monday }}</a></button>

							</td>

							<td>
								<button class="btn btn-app  btn-xs" v-show="emp.tuesday"style="background-color:#87B87F;"><a clas="btn btn-app btn-inverse btn-xs"v-show="emp.tuesday" style="color:#FFFFFF"value="2">{{ emp.tuesday }}</a></button>

							</td>

							<td>
								<button class="btn btn-app  btn-xs" v-show="emp.wednesday"style="background-color:#87B87F;"><a clas="btn btn-app btn-inverse btn-xs"v-show="emp.wednesday" style="color:#FFFFFF"value="3">{{ emp.wednesday }}</a></button>
							</td>

							<td>
								<button class="btn btn-app  btn-xs" v-show="emp.thursday"style="background-color:#87B87F;"><a clas="btn btn-app btn-inverse btn-xs"v-show="emp.thursday" style="color:#FFFFFF"value="4">{{ emp.thursday }}</a></button>
							</td>
							<td>
								<button class="btn btn-app  btn-xs" v-show="emp.friday"style="background-color:#87B87F;"><a clas="btn btn-app btn-inverse btn-xs"v-show="emp.friday" style="color:#FFFFFF"value="5">{{ emp.friday }}</a></button>

							</td>
							<td>
								<button class="btn btn-app  btn-xs" v-show="emp.saturday"style="background-color:#87B87F;"><a clas="btn btn-app btn-inverse btn-xs"v-show="emp.saturday" style="color:#FFFFFF"value="6">{{ emp.saturday }}</a></button>
							</td>
							<td>
								<button class="btn btn-app  btn-xs" v-show="emp.sunday"style="background-color:#87B87F;"><a clas="btn btn-app btn-inverse btn-xs"v-show="emp.sunday" style="color:#FFFFFF"value="7">{{ emp.sunday }}</a></button>
							</td>

						</tr>
						</tbody>
					</table>
					<!--<a href="http://localhost:8080/es_healthy/updateDoctor.html?id=13"class="btn btn-primary active"  aria-pressed="false">22222</a>-->
				</div>
			</div>

					</div>


						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->

								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->

			<div class="footer">
				<div class="footer-inner">
					<div class="footer-content">
						<span class="bigger-120">
							<span class="blue bolder">Ace</span>
							Application &copy; 2013-2014
						</span>

						&nbsp; &nbsp;
						<span class="action-buttons">
							<a href="#">
								<i class="ace-icon fa fa-twitter-square light-blue bigger-150"></i>
							</a>

							<a href="#">
								<i class="ace-icon fa fa-facebook-square text-primary bigger-150"></i>
							</a>

							<a href="#">
								<i class="ace-icon fa fa-rss-square orange bigger-150"></i>
							</a>
						</span>
					</div>
				</div>
			</div>

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script src="assets/js/jquery-2.1.4.min.js"></script>

		<!-- <![endif]-->

		<!--[if IE]>
<script src="assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->

		<!-- ace scripts -->
		<script src="assets/js/ace-elements.min.js"></script>
		<script src="assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->
	</body>
	<script src="/es_healthy/js/vue.js"></script>
	<script src="/es_healthy/js/axios.min.js"></script>
	<script>
		var app = new Vue({
			el:"#wrap",
			data:{
			aid:0,
			schedulings:[],
			status:"none",
			schedule:"",
			oneweek:[]

			},
			methods:{
				//查询预约列表方法
				findAll(aid){
					var _this = this;
					this.status="block";
					axios.get("http://localhost:8080/es_healthy/doctor/findTime?aid="+this.aid+"&token="+sessionStorage.getItem("token")).then(res=>{
						_this.schedulings = res.data.schedulings;
						// console.log(this.oneweek);

					})
				},
				getWeek (day) {
					var today = new Date();
					var targetday_milliseconds=today.getTime() + 1000*60*60*24*day;
					today.setTime(targetday_milliseconds);
					var tYear = today.getFullYear();
					var tMonth = today.getMonth();
					var tDate = today.getDate();
					tMonth = this.doHandleMonth(tMonth + 1);
					tDate =  this.doHandleMonth(tDate);
					return tYear+"-"+tMonth+"-"+tDate;
				},
				doHandleMonth(month){
					var m = month;
					if(month.toString().length == 1){
						m = "0" + month;
					}
					return m;
				},

			},
			created(){
				let data=[]
				for(let i=0;i<=6;i++){
					data.push(this.getWeek(i))
				}
				this.oneweek=data;
				console.log(data);

			}

		});
	</script>
</html>
